package com.pingan.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RespResult<T> {
    private String status;
    private String reason;
    private T data;

    public RespResult(T t){
        this.status="200";
        this.reason="OK";
        this.data = t;
    }

    public static RespResult fail(Object data){
        RespResult respResult = new RespResult();
        respResult.setStatus("500");
        respResult.setReason("服务器错误，请稍后重试");
        respResult.setData(data);
        return respResult;
    }
}
